<?

class wowheaditem{

	var $id;
	var $idItem;
	var $nom;
	var $nom2;
	var $tooltip;
	var $icon;
	var $model;
	var $slot;

	function wowheaditem($var){
		if(is_object($var)){
			$this->id=$var->id;
			$this->idItem=$var->idItem;
			$this->nom=$var->nom;
			$this->nom2=$var->nom2;
			$this->tooltip=$var->tooltip;
			$this->icon=$var->icon;
			$this->model=$var->model;
			$this->slot=$var->slot;
		}
		if(is_array($var)){
			$this->id=$var["id"];
			$this->idItem=$var["idItem"];
			$this->nom=$var["nom"];
			$this->nom2=$var["nom2"];
			$this->tooltip=$var["tooltip"];
			$this->icon=$var["icon"];
			$this->model=$var["model"];
			$this->slot=$var["slot"];
		}
	}

	function get_id(){ return stripslashes($this->id); }
	function set_id($value){ $this->id=$value; }
	function get_idItem(){ return stripslashes($this->idItem); }
	function set_idItem($value){ $this->idItem=$value; }
	function get_nom(){ return stripslashes($this->nom); }
	function set_nom($value){ $this->nom=$value; }
	function get_nom2(){ return stripslashes($this->nom2); }
	function set_nom2($value){ $this->nom2=$value; }
	function get_tooltip(){ return stripslashes($this->tooltip); }
	function set_tooltip($value){ $this->tooltip=$value; }
	function get_icon(){ return stripslashes($this->icon); }
	function set_icon($value){ $this->icon=$value; }
	function get_model(){ return stripslashes($this->model); }
	function set_model($value){ $this->model=$value; }
	function get_slot(){ return stripslashes($this->slot); }
	function set_slot($value){ $this->slot=$value; }


	function ajouter(){
		global $sql;
		$sqlr="insert into ".CFG_MYSQL_PREFIX."wowheaditem(idItem,nom,nom2,tooltip,icon,model,slot) values('".addslashes($this->idItem)."','".addslashes($this->nom)."','".addslashes($this->nom2)."','".addslashes($this->tooltip)."','".addslashes($this->icon)."','".addslashes($this->model)."','".addslashes($this->slot)."')";
		$sql->query($sqlr,0);
	}

	function maj(){
		global $sql;
		$sql->query("update ".CFG_MYSQL_PREFIX."wowheaditem set idItem='".addslashes($this->idItem)."',nom='".addslashes($this->nom)."',nom2='".addslashes($this->nom2)."',tooltip='".addslashes($this->tooltip)."',icon='".addslashes($this->icon)."',model='".addslashes($this->model)."',slot='".addslashes($this->slot)."' where id=".$this->id,0);
	}

}